<template>
	<!-- 球馆 statr -->
	<view class="meadowlands">
		<view class="bg1">
			<view></view>
		</view>
		<view class="dian"></view>
		<uv-navbar :fixed="false" :placeholder="true" bg-color="transparent" @leftClick="back">
			<image slot="left" src="https://www.guizhouqy.com/mini/back.png" style="width: 48rpx;height: 48rpx;">
			</image>
			<text slot="center" style="font-weight: bold;font-size: 32rpx;color: #FFFFFF;">预约</text>
		</uv-navbar>
		<view class="box1">
			<view class="miscellaneous">
				<view class="left">
					<image :src="detailArray.avatar" mode=""></image>
					<view class="sundries">
						<view class="name">{{detailArray.assistant_name}}</view>
						<view class="tip">{{detailArray.signature}}</view>
					</view>
				</view>
				<view class="right">
					{{detailArray.price}}元/分钟
				</view>
			</view>
		</view>
		<view class="box2">
			<scroll-view class="ss-scroll-navbar" scroll-x :scroll-left="scrollLeft" scroll-with-animation="true">
				<view v-for="(item, index) in navArr" :key="index" class="nav-item" @click="tabChange(index)"
					:id="'item-' + index">
					<text class="title" :class="index == currentIndex?'example':''">{{item.title}}</text>
				</view>
			</scroll-view>
		</view>
		<view class="box3">
			<swiper class="swiper" circular :indicator-dots="false" @change="handleSwiperChange" :autoplay="autoplay"
				:interval="interval" :duration="duration">
				<swiper-item v-for="(item,index) in navArr" class="banner" :key="index">
					<view class="item" v-for="(timeSlot,s) in timeSlots" :key="s">
						<view :class="['timeSlot', 
								{ 'timeActive1': isTimeSelected(timeSlot, navArr[tabCurrentIndex].date), 
								  'timeActive2': !isTimeAvailable(timeSlot, navArr[tabCurrentIndex].date),
								  'timeActive3': isTimeAvailable(timeSlot, navArr[tabCurrentIndex].date) && !isTimeSelected(timeSlot, navArr[tabCurrentIndex].date)
								}]" @click="toggleTimeSelection(timeSlot, navArr[tabCurrentIndex].date)">
							<text>{{timeSlot}}</text>
							<image v-if="isTimeSelected(timeSlot, navArr[tabCurrentIndex].date)"
								src="https://www.guizhouqy.com/mini/to.png" mode=""></image>
							<image v-if="!isTimeAvailable(timeSlot, navArr[tabCurrentIndex].date)"
								src="https://www.guizhouqy.com/mini/wrong.png" mode=""></image>
						</view>
					</view>
				</swiper-item>
			</swiper>
			<!-- 自定义指示点 -->
			<view class="custom-dots">
				<view v-for="(item, index) in navArr" :key="index" :class="['dot', { active: currentIndex === index }]">
				</view>
			</view>
		</view>
		<view class="box4">
			<view class="item">
				<text>预约时长</text>
				<picker @change="bindPickerChangeTime" :value="hourIndex" :range="hour">
					<view class="hour">{{hour[hourIndex]}}
						<image src="https://www.guizhouqy.com/mini/down.png" mode=""></image>
					</view>
				</picker>
			</view>
		</view>
		<view class="box4">
			<view class="item">
				<text>台球室地址</text>
				<view class="hour">
					<input v-model="room_address" placeholder-style="color:#ffffff" placeholder="请输入台球室地址" />
				</view>
				<!-- 				<picker @change="bindPitchChange" :value="pitchIndex" :range="pitchNameList">
					<view class="hour">{{pitchNameList[pitchIndex]}}
						<image src="https://www.guizhouqy.com/mini/down.png" mode=""></image>
					</view>
				</picker> -->
			</view>
		</view>
		<view class="box4">
			<view class="item">
				<text>联系人</text>
				<view class="hour">
					<input v-model="contact" placeholder-style="color:#ffffff" placeholder="请输入联系人" />
				</view>
			</view>
		</view>
		<view class="box4">
			<view class="item">
				<text>手机号</text>
				<view class="hour">
					<input v-model="phone" placeholder-style="color:#ffffff" type="number" maxlength="11"
						placeholder="请输入手机号" />
				</view>
			</view>
		</view>
		<view class="box5">
			<view class="item">
				<text>备注</text>
				<view class="hour">
					<textarea v-model="remarks" placeholder-style="color:#ffffff" placeholder="请输入备注" />
				</view>
			</view>
		</view>
		<view class="box6">
			<view class="item">
				<view class="left">
					<image src="https://www.guizhouqy.com/mini/wchat.png" mode=""></image>
					<text>微信支付</text>
				</view>
				<view class="right">
					<view class="yuan">
						<image src="https://www.guizhouqy.com/mini/tips.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
		<view class="box7">
			<checkbox value="cb" :checked="true" style="transform:scale(0.7)" />选中
			<text>提交订单则代表您同意</text>
			<text style="color: #9A24B9;">《下单须知》 </text>
		</view>
		<view class="box8">
			<text>合计：</text>
			<text style="color: #E85A57;font-size: 32rpx;margin-left: 10rpx;">¥</text>
			<text style="color: #E85A57;font-size: 48rpx;margin-left: 8rpx;">{{ total }}</text>
		</view>
		<view class="box9 bottom-safe">
			<view class="but" @click="submit">提交订单</view>
		</view>
	</view>
	<!-- 球馆 end -->
</template>

<script>
	import {
		goLogin,
		checkLogin
	} from '@/libs/login';
	export default {
		data() {
			return {
				scrollLeft: 0,
				widthList: [],
				screenWidth: 0,
				tabCurrentIndex: 0,
				currentIndex: 0,
				indicatorDots: true,
				autoplay: false,
				interval: 2000,
				duration: 500,
				hour: ['2小时', '3小时', '4小时', '5小时', '6小时', '7小时', '8小时', '9小时', '10小时', '11小时', '12小时'],
				hourIndex: 0,
				remarks: "",
				phone: "",
				contact: "",
				room_id: "",
				appointment_duration: 2,
				appointment_time: "",
				assistant_id: "",
				detailArray: {},
				navArr: [], // 初始化为空数组
				timeSlots: [], // 存储时间区间
				selectedTimes: {}, // 改为对象，按日期存储选中的时间段 {日期: [时间段1, 时间段2]}
				unavailableTimes: {}, // 改为对象，按日期存储不可用的时间段
				pitchList: [],
				pitchNameList: [],
				pitchIndex: 0,
				room_address: '', // 台球馆地址
				totalPrice: 0.00 // 合计
			}
		},
		onLoad(options) {
			this.assistant_id = options.user_id
			// 初始化时设置默认选中的日期为今天
			const today = new Date().toISOString().split('T')[0];
			this.getData(options.user_id)
			// this.getTime(options.id, today)
			// this.getarenas() //查询球馆
			this.getTimeSlotsForDate(today);
		},
		created() {
			var that = this;
			this.calculateWindowWidth();
			// 动态生成日期数组
			this.navArr = this.generateDateArray();
			// 初始化选中时间段和不可用时间段对象
			this.selectedTimes = {};
			this.unavailableTimes = {};
			setTimeout(function() {
				that.calculateItemWidth();
			}, 1000);
		},
		methods: {
			async getarenas() {
				let res = await this.$api.meadowlands.getarenas.get({})
				uni.hideLoading()
				if (res.code == 0) {
					this.pitchList = res.data
					let data = res.data
					data.forEach(function(e) {
						this.pitchNameList.push(e.name)
					}, this);
				} else {
					this.$tool.error(res.msg);
				}
			},
			async getData(user_id) {
				let res = await this.$api.meadowlands.getAssistantDetails.get({
					user_id
				})
				uni.hideLoading()
				if (res.code == 0) {
					this.detailArray = res.data
				} else {
					this.$tool.error(res.msg);
				}
			},

			// 生成动态日期数组
			generateDateArray() {
				const dates = [];
				const today = new Date();
				for (let i = 0; i < 9; i++) {
					const date = new Date();
					date.setDate(today.getDate() + i);
					const month = date.getMonth() + 1;
					const day = date.getDate();
					if (i === 0) {
						// 第一天显示"今天+日期"
						dates.push({
							title: `今天${month}.${day}`,
							date: date.toISOString().split('T')[0] // 保存完整日期用于后续使用
						});
					} else {
						// 其他天只显示"月.日"
						dates.push({
							title: `${month}.${day}`,
							date: date.toISOString().split('T')[0]
						});
					}
				}

				return dates;
			},

			// 生成时间区间（半小时间隔）
			generateTimeSlots() {
				const slots = [];
				const now = new Date();

				// 获取当前时间的小时和分钟
				let currentHour = now.getHours();
				let currentMinute = now.getMinutes();

				// 计算下一个半小时时间点
				let startHour = currentHour;
				let startMinute = currentMinute < 30 ? 30 : 0;
				if (currentMinute >= 30) {
					startHour = currentHour + 1;
					startMinute = 0;
				}

				// 生成从当前时间开始到晚上10点的时间段
				for (let hour = startHour; hour < 24; hour++) {
					for (let minute of [0, 30]) {
						// 跳过已经过去的时间
						if (hour === startHour && minute < startMinute) {
							continue;
						}

						const timeString = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
						slots.push(timeString);

						// 限制生成的数量，比如生成20个时间段
						if (slots.length >= 20) {
							break;
						}
					}
					if (slots.length >= 20) {
						break;
					}
				}

				return slots;
			},

			//提交预约订单
			async submit() {
			
				let self = this;
				// 收集所有选中的时间段
				const allSelectedTimes = [];
				for (const date in this.selectedTimes) {
					if (this.selectedTimes[date].length > 0) {
						this.selectedTimes[date].forEach(timeSlot => {
							allSelectedTimes.push(`${date} ${timeSlot}`);
						});
					}
				}
				if (allSelectedTimes.length === 0) {
					this.$tool.error("请选择一个时间段");
					return;
				}
				if (!this.contact || this.contact.trim() === '') {
					this.$tool.error("请输入联系人");
					return;
				}
				if (this.phone == "") {
					this.$tool.error("请输入手机号");
					return;
				}
				// 格式检查：1开头的11位数字
				const phoneRegex = /^1[3-9]\d{9}$/;
				if (!phoneRegex.test(this.phone)) {
					this.$tool.error("请输入正确的手机号");
					return;
				}
				uni.showLoading({
					title: '正在预约...'
				});
				this.pitchList.forEach(function(e) {
					if (e.name == this.pitchNameList[this.pitchIndex]) {
						this.room_id = e.id
					}
				}, this);
				let data = {
					remarks: this.remarks,
					phone: this.phone,
					contact: this.contact,
					// room_id: this.room_id, 台球室id，20250906改为手动输入
					appointment_duration: this.appointment_duration,
					appointment_start_time: `${Object.keys(this.selectedTimes)[0]} ${this.selectedTimes[Object.keys(this.selectedTimes)[0]][0]}`, // JSON.stringify(this.selectedTimes), // 改为复数，支持多个时间段 // 20250906改为一次预约只能选择一个时间段
					assistant_user_id: this.assistant_id,
					room_address: this.room_address, // 手动输入的台球室名称
					totalPrice: this.totalPrice // 总价
				};
				let res = await this.$api.meadowlands.addOrder.post(data);
				uni.hideLoading();
				if (res.code == 0) {
					const data = res.data

					uni.requestPayment({
						"provider": "wxpay",
						"appId": data.appId,
						"timeStamp": data.timeStamp,
						"nonceStr": data.nonceStr,
						"package": data.package,
						"signType": data.signType,
						"paySign": data.paySign,
						success(data) {
							uni.showToast({
								title:'支付成功',
								icon:'none'
							})
							setTimeout(() => {
								uni.redirectTo({
									url: '/pages/help/success?id='+ res.msg + "&userid=" + self.assistant_id
								})
							}, 100)
						},
						fail(e) {
							uni.showToast({
								title:'支付失败',
								icon:'none'
							})
							// self.$tool.error('支付失败');
							// setTimeout(() => {
							// 	uni.redirectTo({
							// 		url: directUrl
							// 	})
							// }, 100)
							// uni.redirectTo({
							// 	url: directUrl
							// })
						}
					})

					// this.$tool.success(res.msg);
					// this.navTo('/pages/help/success?id=' + res.msg + "&userid=" + this.assistant_id)
				} else {
					this.$tool.error(res.msg);
				}
			},
			//选择预约球馆
			bindPitchChange: function(e) {
				this.pitchIndex = e.detail.value
			},
			//选择预约时长
			bindPickerChangeTime: function(e) {
				this.hourIndex = e.detail.value
				if (e.detail.value == 0) {
					this.appointment_duration = 2
				}
				if (e.detail.value == 1) {
					this.appointment_duration = 3
				}
				if (e.detail.value == 2) {
					this.appointment_duration = 4
				}
				if (e.detail.value == 3) {
					this.appointment_duration = 5
				}
				if (e.detail.value == 4) {
					this.appointment_duration = 6
				}
				if (e.detail.value == 5) {
					this.appointment_duration = 7
				}
				if (e.detail.value == 6) {
					this.appointment_duration = 8
				}
				if (e.detail.value == 7) {
					this.appointment_duration = 9
				}
				if (e.detail.value == 8) {
					this.appointment_duration = 10
				}
				if (e.detail.value == 9) {
					this.appointment_duration = 11
				}
				if (e.detail.value == 10) {
					this.appointment_duration = 12
				}
			},

			handleSwiperChange(e) {
				this.currentIndex = e.detail.current;
				this.tabCurrentIndex = e.detail.current;
				const selectedDate = this.navArr[e.detail.current].date;

				// 获取新日期的时间段数据
				this.getTimeSlotsForDate(selectedDate);
			},

			/**
			 * 导航栏navbar
			 * 点击事件
			 */
			async tabChange(index) {
				this.tabCurrentIndex = index;
				this.currentIndex = index;
				const selectedDate = this.navArr[index].date;

				// 获取新日期的时间段数据
				await this.getTimeSlotsForDate(selectedDate);

				// 滚动逻辑保持不变...
				var widthArr = this.widthList;
				var scrollWidth = 0;
				for (var i = 0; i < index + 1; i++) {
					scrollWidth += widthArr[i];
				}
				let currentWidth = widthArr[index];
				scrollWidth -= this.screenWidth / 2;
				scrollWidth -= currentWidth / 2;
				this.scrollLeft = scrollWidth;
				// 强制swiper切换到对应页面（如果有ref）
				if (this.$refs.swiper) {
					this.$refs.swiper.swipeTo(index);
				}
			},
			// 根据日期获取时间段
			async getTimeSlotsForDate(date) {
				uni.showLoading({
					title: '加载中'
				});

				try {
					// 如果已经获取过该日期的时间段数据，则不再重复获取
					if (this.unavailableTimes[date]) {
						// 生成时间段（如果是今天，从当前时间开始）
						if (this.isToday(date)) {
							this.timeSlots = this.generateTimeSlotsFromNow();
						} else {
							// 其他日期从早上9点开始
							this.timeSlots = this.generateTimeSlotsFromTime(9, 0);
						}
						uni.hideLoading();
						return;
					}

					// 调用API获取指定日期的可用时间段
					let res = await this.$api.meadowlands.gettimeQuery.get({
						assistant_id: this.assistant_id,
						appointment_date: date
					});

					if (res.code == 0) {
						// 存储不可用时间段
						// this.$set(this.unavailableTimes, res.data);
						this.unavailableTimes = res.data

						// 生成时间段（如果是今天，从当前时间开始）
						if (this.isToday(date)) {
							this.timeSlots = this.generateTimeSlotsFromNow();
						} else {
							// 其他日期从早上9点开始
							this.timeSlots = this.generateTimeSlotsFromTime(9, 0);
						}
					} else {
						this.$tool.error(res.msg);
					}
				} catch (error) {
					console.error("获取时间段失败:", error);
					this.$tool.error("获取时间段失败");
				} finally {
					uni.hideLoading();
				}
			},
			// 检查是否是今天
			isToday(dateString) {
				const today = new Date().toISOString().split('T')[0];
				return dateString === today;
			},
			// 从指定时间开始生成时间段
			generateTimeSlotsFromTime(startHour, startMinute) {
				const slots = [];

				for (let hour = startHour; hour < 24; hour++) {
					for (let minute of [0, 30]) {
						// 跳过已经过去的时间（对于今天）
						if (this.isToday(this.navArr[this.tabCurrentIndex].date) &&
							(hour < new Date().getHours() ||
								(hour === new Date().getHours() && minute < new Date().getMinutes()))) {
							continue;
						}

						const timeString = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
						slots.push(timeString);

						// 限制生成的数量
						// if (slots.length >= 20) {
						// 	break;
						// }
					}
					// if (slots.length >= 20) {
					// 	break;
					// }
				}

				return slots;
			},
			// 从当前时间开始生成时间段
			generateTimeSlotsFromNow() {
				const slots = [];
				const now = new Date();

				// 获取当前时间的小时和分钟
				let currentHour = now.getHours();
				let currentMinute = now.getMinutes();

				// 计算下一个半小时时间点
				let startHour = currentHour;
				let startMinute = currentMinute < 30 ? 30 : 0;
				if (currentMinute >= 30) {
					startHour = currentHour + 1;
					startMinute = 0;
				}

				return this.generateTimeSlotsFromTime(startHour, startMinute);
			},

			// 检查时间段是否可用
			isTimeAvailable(timeSlot, date) {
				return !this.unavailableTimes[date] || !this.unavailableTimes[date].includes(timeSlot);
			},

			// 检查时间段是否已选中
			isTimeSelected(timeSlot, date) {
				return this.selectedTimes[date] && this.selectedTimes[date].includes(timeSlot);
			},

			// 切换时间段选择
			toggleTimeSelection(timeSlot, date) {
				// 如果时间段不可用，则不执行任何操作
				if (!this.isTimeAvailable(timeSlot, date)) {
					return;
				}

				// 确保选中时间段数组已初始化
				if (!this.selectedTimes[date]) {
					this.$set(this.selectedTimes, date, []);
				}

				const index = this.selectedTimes[date].indexOf(timeSlot);

				if (index > -1) {
					// 如果已选中，则取消选中
					this.selectedTimes[date].splice(index, 1);
				} else {

					// 改为一次预约只能选择一个时间段
					this.selectedTimes = {
						[date]: [timeSlot]
					};
					// console.log(this.selectedTimes);
					// 如果未选中，则添加到选中列表
					// this.selectedTimes[date].push(timeSlot);
				}

				// 更新UI
				this.timeSlots = [...this.timeSlots];

				console.log("当前选中的时间段:", this.selectedTimes);
			},
			calculateItemWidth() {
				var that = this;
				var arr = [];
				let w = 0;
				this.navArr.forEach((item, index) => {
					let view = uni.createSelectorQuery().in(this).select("#item-" + index);
					view.fields({
						size: true
					}, data => {
						arr.push(data.width);
					}).exec();
				})
				this.widthList = arr;
			},

			calculateWindowWidth() {
				var info = uni.getSystemInfoSync();
				this.screenWidth = info.screenWidth;
			},

			back() {
				uni.navigateBack({
					delta: 1
				});
			},

			navTo(url) {
				uni.navigateTo({
					url
				})
				return
				if (!this.isLogin) {
					goLogin();
				}
			},
		},
		computed: {
			total() {
				const duration = this.appointment_duration * 60
				this.totalPrice = (parseFloat(this.detailArray.price).toFixed(2) * duration).toFixed(2)
				return this.totalPrice
			}
		}

	}
</script>

<style scoped lang="scss">
	/* 添加点击效果 */
	.timeActive3:active {
		opacity: 0.7;
	}

	/* 不可点击样式 */
	.timeActive2 {
		opacity: 0.5;
		pointer-events: none;
	}

	.meadowlands {
		background: #240F41;
		color: #FFFFFF;
		min-height: 100vh;
		padding-bottom: 30rpx;

		.bg1 {
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: center;
			position: absolute;
			left: calc(50%-59px);

			view {
				width: 118px;
				height: 118px;
				background: linear-gradient(90deg, #C829F3 0%, #4516CA 100%);
				box-shadow: inset 0rpx 8rpx 8rpx 0rpx rgba(0, 0, 0, 0.25);
				border-radius: 0rpx 0rpx 0rpx 0rpx;
				opacity: 0.9;
				filter: blur(90px);
			}
		}

		.dian {
			width: 118px;
			height: 118px;
			background: linear-gradient(90deg, #1F87EF 0%, #1F87EF 100%);
			box-shadow: inset 0rpx 8rpx 8rpx 0rpx rgba(0, 0, 0, 0.25);
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			opacity: 0.9;
			filter: blur(90px);
			position: absolute;
			left: 0;
			top: 20px;
		}

		.header {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			padding: 0 38rpx;
			padding-top: 30px;

			image {
				width: 48rpx;
				height: 48rpx;
				z-index: 999;
			}
		}

		.box1 {
			padding: 0 26rpx;
			z-index: 999;

			.miscellaneous {
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 62rpx;
				width: 100%;
				height: 160rpx;
				background: linear-gradient(180deg, #9A24B9 0%, #7116E9 100%);
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				border: 2rpx solid #9A24B9;
				margin-top: 24rpx;

				.left {
					display: flex;
					flex-direction: row;
					align-items: center;
					padding-left: 34rpx;

					image {
						width: 96rpx;
						height: 96rpx;
						border-radius: 116rpx 116rpx 116rpx 116rpx;
						border: 4rpx solid #9A24B9;
						border-radius: 50%;
					}

					.sundries {
						margin-left: 26rpx;

						.name {
							font-weight: bold;
							font-size: 32rpx;
							color: #FFFFFF;
						}

						.tip {
							font-weight: bold;
							font-size: 24rpx;
							color: #999999;
							margin-top: 8rpx;
						}
					}
				}

				.right {
					padding-right: 28rpx;
					font-weight: 500;
					font-size: 32rpx;
					color: #FFFFFF;
				}
			}
		}

		.box2 {
			margin-top: 48rpx;
			padding: 0 26rpx;
		}
	}

	.ss-scroll-navbar {
		width: 100%;
		box-shadow: 0 2upx 8upx rgba(0, 0, 0, .06);
		white-space: nowrap;
		padding-bottom: 16rpx;
		border-bottom: 2rpx solid rgba(217, 233, 245, 0.2);

		.nav-item {
			text-align: center;
			padding: 0rpx 32rpx;
			color: #999999;
			display: inline-block;
			position: relative;
			font-size: 28rpx;
			font-weight: 500;
		}

		.nav-item:nth-child(1) {
			padding-left: 0;
		}
	}

	.example {
		background: linear-gradient(222.90278493605044deg, #7116E9 0%, #15D1E2 100%);
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
	}

	.banner {
		display: flex;
		flex-wrap: wrap;
		align-content: start;

		.item {
			width: 22%;
			height: 48rpx;
			margin-left: 4%;
			margin-bottom: 2%;

			view {
				height: 100%;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: center;
				position: relative;
				color: #FFFFFF;
				font-size: 24rpx;
				font-weight: 500;
			}

			.timeActive1 {
				background: linear-gradient(90deg, #C829F3 0%, #4516CA 100%);
				border: 2rpx solid #9A24B9;
			}

			.timeActive2 {
				background: linear-gradient(90deg, #C829F3 0%, #4516CA 100%);
				border: 2rpx solid #9A24B9;
			}

			.timeActive3 {
				border: 2rpx solid #999999;
			}

			image {
				position: absolute;
				bottom: 0;
				right: 0;
				width: 24rpx;
				height: 24rpx;
			}
		}

		.item:nth-child(4n-3) {
			margin-left: 0;
		}


	}

	.custom-dots {
		display: flex;
		justify-content: center;
		position: absolute;
		left: 50%;
		/* 水平居中 */
		bottom: -16rpx;
		/* 距离底部距离 */
		transform: translateX(-50%);
		/* 修正居中偏移 */
		z-index: 10;
		/* 确保在轮播图上层 */
	}

	.dot {
		width: 32rpx;
		height: 8rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		margin: 0 10rpx;
		background: #FFFFFF;
		transition: all 0.3s;
	}

	.dot.active {
		width: 32rpx;
		background: linear-gradient(90deg, #C829F3 0%, #4516CA 100%);
	}

	.box {
		margin: 0 26rpx;

		.title1 {
			font-size: 28rpx;
			color: #FFFFFF;
			margin-top: 45rpx;
		}

		.list {
			.item {
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				margin-top: 32rpx;
				border-bottom: 1rpx solid #C829F3;
				padding-bottom: 32rpx;

				.content {
					display: flex;
					flex-direction: row;
					align-items: center;

					image {
						width: 144rpx;
						height: 144rpx;
					}

					.miscellaneous {
						margin-left: 32rpx;

						.name {
							font-size: 28rpx;
							color: #FFFFFF;
						}

						.time {
							display: flex;
							flex-direction: row;
							align-items: center;
							justify-content: center;
							width: 236rpx;
							height: 32rpx;
							background: linear-gradient(180deg, #9A24B9 0%, #7116E9 100%);
							border-radius: 48rpx 48rpx 48rpx 48rpx;
							border: 2rpx solid #9A24B9;
							font-size: 20rpx;
							color: #FFFFFF;
							text-align: center;
							margin-top: 26rpx;
						}

						.address_title {
							font-size: 20rpx;
							// color: #FFFFFF;
							margin-top: 26rpx;
							white-space: nowrap;
							/* 强制文本不换行 */
							overflow: hidden;
							/* 隐藏超出部分 */
							text-overflow: ellipsis;
							/* 超出部分显示省略号 */
							max-width: 400rpx;
						}
					}
				}

				.address {
					.km {
						font-size: 24rpx;
						color: #FFFFFF;
						text-align: right;
					}

					.icon {
						margin-top: 67rpx;

						image {
							width: 48rpx;
							height: 48rpx;
						}

						.ml32 {
							margin-left: 32rpx;
						}
					}
				}
			}
		}
	}

	.box3 {
		margin-top: 24px;
		padding: 0 26rpx;
		position: relative;
		
		.swiper {
			height: 480rpx;
		}
	}

	.box4 {
		padding: 0 26rpx;
		margin-top: 34rpx;

		.item {
			width: 100%;
			height: 80rpx;
			background: linear-gradient(180deg, #9A24B9 0%, #7116E9 100%);
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			border: 2rpx solid #9A24B9;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;

			text {
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;
				padding-left: 32rpx;
			}

			.hour {
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: center;
				padding-right: 30rpx;
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;

				image {
					width: 32rpx;
					height: 32rpx;
				}

				input {
					color: #FFFFFF;
					text-align: right;
				}
			}
		}
	}

	.box5 {
		padding: 0 26rpx;
		margin-top: 34rpx;

		.item {
			width: 100%;
			background: linear-gradient(180deg, #9A24B9 0%, #7116E9 100%);
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			border: 2rpx solid #9A24B9;

			text {
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;
				padding-left: 32rpx;
				padding-top: 20rpx;
				display: block;
			}

			.hour {
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;


				textarea {
					color: #FFFFFF;
					padding-left: 32rpx;
					margin-top: 20px;
					padding-right: 32rpx;
					width: 100%;
				}
			}
		}
	}

	.box6 {
		padding: 0 26rpx;
		margin-top: 34rpx;

		.item {
			width: 100%;
			height: 80rpx;
			background: linear-gradient(180deg, #9A24B9 0%, #7116E9 100%);
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			border: 2rpx solid #9A24B9;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;

			.left {
				display: flex;
				flex-direction: row;
				align-items: center;
				padding-left: 28rpx;

				image {
					width: 48rpx;
					height: 48rpx;

				}

				text {
					font-weight: 400;
					font-size: 28rpx;
					color: #FFFFFF;
					margin-left: 8rpx;
				}
			}

			.right {
				padding-right: 32rpx;

				.yuan {
					width: 32rpx;
					height: 32rpx;
					background: #15D1E2;
					border-radius: 50%;
					display: flex;
					flex-direction: row;
					align-items: center;
					justify-content: center;

					image {
						width: 24rpx;
						height: 24rpx;
					}
				}
			}
		}
	}

	.box7 {
		margin-top: 32rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		color: #999999;
		font-size: 24rpx;
	}

	.box8 {
		padding-left: 24rpx;
		margin-top: 30rpx;
		font-weight: 500;
		font-size: 28rpx;
		color: #FFFFFF;
	}

	.box9 {
		padding: 0 24rpx;

		.but {
			width: 100%;
			height: 80rpx;
			background: linear-gradient(313deg, #7116E9 0%, #15D1E2 100%);
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-top: 70rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: center;
			font-weight: bold;
			font-size: 32rpx;
			color: #FFFFFF;
		}
	}
</style>